(* Main window *)
let window1 = 
  ignore (GMain.init ());
  let wnd = GWindow.window
    ~title:"Fear of the Map"
    ~position:`CENTER
    ~width:800
    ~height:600
    ~resizable:false () in
    ignore (wnd#connect#destroy ~callback:GMain.quit);
  wnd


(* Warning dialog when you delete the main window *)
let confirm _ =
  let dialog = GWindow.message_dialog
    ~title:"Fear of the Map"
    ~message:
    "<b><big>Voulez-vous vraiment quitter ?</big></b>\n\n
<u>Attention</u>: toute vos donnees non-sauvegardees seront perdues !"
    ~parent:window1
    ~destroy_with_parent:true
    ~use_markup:true
    ~message_type:`QUESTION
    ~position:`CENTER_ON_PARENT
    ~buttons:GWindow.Buttons.yes_no () in
  let result = dialog#run () = `NO in
    dialog#destroy ();
    result

(* Vertical main box container *)
let vbox1 =
  GPack.vbox
    ~spacing:4
    ~border_width:4
    ~homogeneous:false
    ~packing:window1#add ()

(* NOTEBOOK *)
let notebook1 = 
  GPack.notebook
    ~homogeneous_tabs:true
    ~show_border:true
    ~show_tabs:true
    ~border_width:4
    ~width:700
    ~height:550
    ~packing:vbox1#pack ()

let onglet1 =
  GPack.hbox
  ~homogeneous:false
  ~spacing:4
  ~border_width:4
  ~packing:notebook1#add ()

let onglet2 =
  GPack.hbox
  ~homogeneous:false
  ~spacing:4
  ~border_width:4
  ~packing:notebook1#add ()

let p1 =GEdit.entry ~editable:true
  ~packing:(notebook1#append_page
	      ~tab_label:(GMisc.label ~text:"Text" ())#coerce
              ~menu_label:(GMisc.label ~text:"Text" ())#coerce) ();;

let p2 = GButton.button ~label:"Hello world!"
  ~packing:(notebook1#append_page ~tab_label:(GMisc.label
						~text:"Button" ())#coerce
              ~menu_label:(GMisc.label ~text:"Button" ())#coerce) ();;


let _ =
  ignore (window1#event#connect#delete confirm);
  window1#show ();
  GMain.main ()
